home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 29
/
Volume 29 - JOGO DISK .iso
/
Games
/
jungle_adventure.swf
/
scripts
/
__Packages
/
VR_HiddenPlatform.as
< prev
next >
Wrap
Text File
|
2006-11-29
|
3KB
|
95 lines
class VR_HiddenPlatform extends GameCollectable
{
var assetID = "PlatformToken";
var collected = false;
var totalTime = 20;
var editor_isItem = true;
var editor_name = "VRHiddenPlatform";
var editor_args_names = ["totalTime"];
var editor_args_values = [VR_HiddenPlatform.prototype.totalTime];
var editor_args_types = ["number"];
var editor_args_options = [[10,60,5]];
var editor_args_descriptions = [""];
var editor_args_mode = [0];
var editor_args_component = ["NumericStepper"];
function VR_HiddenPlatform(time)
{
super();
if(time != null)
{
this.totalTime = time;
}
}
function onAddToWorld()
{
if(!_global.VR_ON_PLATFORMS)
{
this.world.removeObject(this);
return undefined;
}
this.world.addToCollection("platforms",this);
}
function onAddDisplay()
{
if(this.collected)
{
this.target._visible = false;
}
}
function reset()
{
this.collected = false;
if(this.inScene)
{
this.target._visible = true;
}
}
function setCollected(obj)
{
if(this.collected)
{
return undefined;
}
if(!VR_HiddenPlatform.activeObj)
{
VR_HiddenPlatform.activeObj = this;
this.getUpdates();
var _loc3_ = undefined;
var _loc2_ = _loc3_ = this.world.collections.VR.length;
while((_loc2_ = _loc2_ - 1) > -1)
{
_loc3_[_loc2_].disabled = false;
_loc3_[_loc2_].target._visible = true;
}
}
this.target._visible = false;
this.collected = true;
VR_HiddenPlatform.activeTime = this.totalTime;
GameSound.playSound("vr");
this.keepInScene = true;
this.getUpdates();
}
function update(elapsed)
{
VR_HiddenPlatform.activeTime = Math.max(VR_HiddenPlatform.activeTime - elapsed,0);
if(!VR_HiddenPlatform.activeTime)
{
this.cancelUpdates();
VR_HiddenPlatform.activeObj = null;
this.keepInScene = false;
var _loc3_ = undefined;
var _loc2_ = _loc3_ = this.world.collections.VR.length;
while((_loc2_ = _loc2_ - 1) > -1)
{
_loc3_[_loc2_].disabled = true;
_loc3_[_loc2_].target._visible = false;
}
_loc2_ = _loc3_ = this.world.collections.platforms.length;
while((_loc2_ = _loc2_ - 1) > -1)
{
_loc3_[_loc2_].reset();
}
}
}
}